<script setup lang="ts">
  import ProTable from '@/components/ProTable';
  import type { ProColumns, FormColumn } from '@/components/ProTable';
  const loadList = async (params: API.PageParams) => {
    console.log(params, 'params');
    return {
      data: [{}, {}, {}, {}],
      total: 4,
    };
  };
  const columns: ProColumns<API.LcdpUser.UserDetailInfo>[] = [
    {
      title: '序号',
      key: 'dataIndex',
    },
    {
      title: '账号',
      key: 'loginId',
    },
    {
      title: '姓名',
      key: 'userName',
    },
    {
      title: '邮箱地址',
      key: 'email',
    },
  ];
  const searchColumns: FormColumn[] = [
    {
      label: '姓名',
      key: 'name',
      valueType: 'text',
      tooltip: '这是一个提示',
    },
    {
      label: '日期',
      key: 'formatDate',
      valueType: 'formatDate',
      fieldProps: {
        ['value-format']: 'yyyy-MM-dd',
      },
    },
    {
      label: '手机',
      key: 'phone',
      valueType: 'text',
    },
    {
      label: '类型',
      key: 'type',
      valueType: 'select',
      fieldProps: {
        options: [
          {
            label: "Everybody's Got Something to Hide Except Me and My Monkey",
            value: 'song0',
            disabled: true,
          },
          {
            label: 'Drive My Car',
            value: 'song1',
          },
          {
            label: 'Norwegian Wood',
            value: 'song2',
          },
        ],
      },
    },
  ];
</script>
<template>
  <div>
    <ProTable
      :search="{
        columns: searchColumns,
      }"
      :request="loadList"
      :columns="columns"
    />
  </div>
</template>

<style scoped></style>
